package com.esun.payment_api.service;

import com.esun.payment_api.bean.ApprovalNodeBean;
import com.esun.payment_api.bean.DkInvoiceBean;
import com.esun.payment_api.bean.InvFormBean;
import com.esun.payment_api.bean.InvProcessBean;
import com.esun.payment_api.dao.InvFormDao;
import com.esun.payment_api.dao.InvFormDetail;
import com.esun.payment_api.domain.InvForm;
import com.esun.payment_api.domain.SysDictCustomer;
import com.esun.payment_api.domain.User;
import com.esun.payment_api.dto.*;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单主表接口
 * Create by benett 2022-03-09 22:37:43
 * */
@Service
public interface InvFormService {

    InvFormBean getById(Integer id);

    int deleteById(Integer id);

    int delete(List<Integer> ids);

    int insert(InvForm invForm);

    int insertReturnId(InvForm invForm);

    int update(InvForm invForm);

    List<InvForm> getList(InvFormQueryParam queryParam,Integer pageSize,Integer pageNum);

    List<InvFormDao> getListByType(InvFormQueryParam queryParam, Integer pageSize, Integer pageNum);
    //按筛选条件，计算：总开票金额
    String getSumMoneyBySearch(InvFormQueryParam queryParam);

    InvFormDetail getDetail(Integer id);

    List<InvForm> getListByAny(String words,Integer pageSize,Integer pageNum);

    List<DkInvoiceBean> claimSelectInvoice(Short companyId, Integer claimId, Integer customerId, String searchStr, Integer pageSize, Integer pageNum);

    //获取发票详细数据
    InvFormDetail getInvDetail(User user, Integer id);

    List<SysDictCustomer> getInvCustomer(Integer invId);

    BigDecimal cancelPassedInv(PInvCancelParam param);

    //获取发票流程
    List<InvProcessBean> getInvProcess(String uuid);

    //通过发票uuid获取发票作废uuid
    String getInvCancelUuid(String uuid);

    //发票申请提交审批
    void invSubmitApproval(SubmitApprovalParam param);

    //被拒后重新提交审批
    void invResubmitApproval(SubmitApprovalParam param);

    //发票申请流程审批 同意1 拒绝-1
    void invProcessApproval(ProcessApprovalParam param);

    //作废发票申请流程审批 同意1 拒绝-1
    void cancelInvProcessApproval(ProcessApprovalParam param);

    //校验发票提交审批
    String checkInvSubmit(Integer id);

    //发票-补充信息
    int updateById(InvForm invForm);

    List<ApprovalNodeBean> getApprovalNodeList(Short coId);

    //发票复制
    BigDecimal invCopy(PInvCopyParam param);

    //通过发票id，获取业务类型business_type
    String getBusinessTypeByInvId(SubmitApprovalParam param);

    //判断当前用户是否有该发票的数据权限
    String checkInvDataAuth(Integer id, Short userId, Short deptId);
}
